TCP2Serial sits in the background and waits for a TCP connection on port 1429. It then feeds any data from that connect to the serial port (well, any CTB tool) and vice versa. I use this to access a serial printer from a unix machine using a simple perl script.
TCP2Serial requires MacTCP and the Communications Toolbox.
To use it, simply launch it, and then connect to port 1429 using TCP and send/receive information.
You can configure TCP2Serial using ResEdit. Edit STR# 128, the first string is the name of the tool (defaults to Serial Tool), the second is the configuaration string, and the third is the TCP port to listen on.
I use this to talk from a unix machine to a serial printer using this perl script on the unix machine:
*****
#!/usr/local/bin/perl
$AF_INET = 2;
$PF_INET = 2;
$SOCK_STREAM = 2; # May need to be 1 on non-olaris machines
socket($file, $PF_INET, $SOCK_STREAM, $proto) || die "socket: $!";
if ($localport != 0) {
bind($file,$this) || die "bind: $!";
}
connect($file, $that) || die "connect: $!";
$old=select($file); $| = 1; select($old);
}
*****
• Limitations
TCP2Serial requires MacTCP and the Communications Toolbox.
• Small Print
This program is freeware. You may use it without charge and it may be distributed on online services. Commercial distribution of this program is not allowed without my permission.
You MAY NOT DISTRIBUTE this program on any disk costing more than $5 without my explicit permission.
• Warranty
This program should do what I’ve described in this document. If it doesn’t, you can simply stop using it.
• Fine Print
Peter Lewis hereby disclaims all warranties relating to this software, whether express or implied, including without limitation any implied warranties of merchantability or fitness for a particular purpose. Peter Lewis will not be liable for any special, incidental, consequential, indirect or similar damages due to loss of data or any other reason, even if Peter Lewis or an agent of his has been advised of the possibility of such damages. In no event shall Peter Lewis be liable for any damages, regardless of the form of the claim. The person using the software bears all risk as to the quality and performance of the software.